<template>
  <el-text
    :type="widget.options.type"
    :size="widget.options.size"
    :truncated="widget.options.truncated"
    :line-clamp="widget.options.lineClamp"
    :tag="widget.options.tag"
    @click.stop="selectField"
  >
  <slot></slot>
    {{ widget.options.text }}
  </el-text>
</template>

<script setup>
import { assignmentWidget } from "@/views/pageDesign/components/globalVariable";
defineOptions({
  name: "textWidget",
  inheritAttrs: false,
});

let $props = defineProps({
  widget: {
    type: Object,
    required: true,
  },
});

let selectField = () => {
  assignmentWidget($props.widget);
};
</script>

<style lang="scss" scoped></style>
